// 组件的内部配置,不随JSON配置文件传递,仅存在于设计器及渲染器中,以减轻数据传输压力
/*
    name: '文字' 组件名称
    icon: 'text' 组件图标
    notFormItem: true 是否生成el-form-item true:不生成
    showDefaultValue: 是否显示默认值配置输入框
 */
export const positionOptions = [
  { label: '左对齐', value: 'left', icon: 'align-left' },
  { label: '居中', value: 'center', icon: 'align-center' },
  { label: '右对齐', value: 'right', icon: 'align-right' }
]
export const customClassConfig = {
  name: 'customClass',
  title: '自定义样式',
  borderTop: true,
  setter: {
    componentName: 'CustomClassSetter'
  }
}
export const eventConfig = {
  name: 'events',
  title: '动作设置',
  borderTop: true,
  direction: 'vertical',
  setter: { componentName: 'EventsSetter' }
}
export const RuleConfig = {
  title: '组件属性',
  borderTop: true,
  setter: { componentName: 'RulesSetter' }
}
export const TypeConfig = {
  name: 'type',
  title: '组件类型',
  setter: { componentName: 'TextSetter' }
}
export const LabelWidthConfig = {
  name: 'labelWidth',
  title: '名称宽度',
  switch: 'isLabelWidth',
  setter: { componentName: 'WidthSetter' }
}
export const HideLabelConfig = {
  name: 'hideLabel',
  title: '隐藏名称',
  borderTop: true,
  setter: { componentName: 'SwitchSetter' }
}
export const WidthConfig = {
  name: 'width',
  title: '组件宽度',
  switch: 'isWidgetWidth',
  setter: { componentName: 'WidthSetter' }
}
export const NameConfig = {
  name: 'name',
  title: '名称',
  required: true,
  setter: { componentName: 'NameSetter' }
}
export const placeholderConfig = {
  name: 'placeholder',
  title: '占位内容',
  borderTop: true,
  setter: { componentName: 'InputSetter' }
}
// 单行文本配置
export const inputConfig = [
  {
    title: '基础属性',
    collapseName: 'commonConfig',
    configs: [
      TypeConfig,
      NameConfig,
      placeholderConfig,
      {
        name: 'isVariableDefaultValue',
        title: '默认值类型',
        setter: {
          componentName: 'RadioSetter',
          helpWarn: true, // 帮助提示
          props: {
            options: [
              { label: '静态数据', value: 'static' },
              { label: '变量', value: 'variable' },
              { label: '计算公式', value: 'formula' }
            ]
          }
        }
      },
      {
        name: 'defaultValue',
        title: '默认值',
        setter: {
          componentName: 'DefaultValueSetter'
        }
      },
      HideLabelConfig,
      LabelWidthConfig,
      WidthConfig,
      customClassConfig,
      {
        borderTop: true,
        direction: 'vertical',
        setter: { componentName: 'InputRelatedFormSetter' }
      },
      RuleConfig,
      eventConfig
    ]
  },
  {
    title: '校验属性',
    collapseName: 'validateConfig',
    configs: [
      {
        direction: 'vertical',
        setter: {
          componentName: 'RuleSetter',
          rules: ['must', 'common', 'regexp', 'custom']
        }
      }
    ]
  }
]
// 数字配置
export const numberConfig = [
  {
    title: '基础属性',
    collapseName: 'commonConfig',
    configs: [
      TypeConfig,
      NameConfig,
      {
        name: 'isVariableDefaultValue',
        title: '默认值类型',
        borderTop: true,
        setter: {
          componentName: 'RadioSetter',
          props: {
            options: [
              { label: '静态数据', value: 'static' },
              { label: '计算公式', value: 'formula' }
            ]
          }
        }
      },
      {
        name: 'defaultValue',
        title: '默认值',
        setter: {
          componentName: 'DefaultValueSetter',
          rows: 1
        }
      },
      HideLabelConfig,
      LabelWidthConfig,
      WidthConfig,
      customClassConfig,
      // 精度开关
      {
        direction: 'vertical',
        borderTop: true,
        setter: { componentName: 'PrecisionSetter' }
      },
      // 控制按钮
      {
        direction: 'vertical',
        setter: { componentName: 'BtnControlSetter' }
      },
      // 显示单位
      {
        direction: 'vertical',
        setter: { componentName: 'UnitSwitchSetter' }
      },
      RuleConfig,
      eventConfig
    ]
  },
  {
    title: '校验属性',
    collapseName: 'validateConfig',
    configs: [
      {
        direction: 'vertical',
        setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
      }
    ]
  }
]
// 单选框配置
export const radioConfig = [
  {
    title: '基础属性',
    collapseName: 'commonConfig',
    configs: [
      TypeConfig,
      NameConfig,
      HideLabelConfig,
      LabelWidthConfig,
      WidthConfig,
      customClassConfig,
      {
        name: 'inline',
        title: '布局方式',
        borderTop: true,
        setter: {
          componentName: 'RadioSetter',
          props: {
            options: [
              { label: '块级', value: false },
              { label: '行内', value: true }
            ]
          }
        }
      },
      {
        name: 'optionStyle',
        title: '样式',
        tip: '选项样式: 子表单中该项建议设置为经典',
        setter: {
          componentName: 'RadioSetter',
          props: {
            options: [
              { label: '经典', value: 'default' },
              { label: '带边框', value: 'border' },
              { label: '按钮', value: 'button' }
            ]
          }
        }
      },
      {
        direction: 'vertical',
        setter: { componentName: 'RemoteOptionsSetter' }
      },
      RuleConfig,
      eventConfig
    ]
  },
  {
    title: '校验属性',
    collapseName: 'validateConfig',
    configs: [
      {
        direction: 'vertical',
        setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
      }
    ]
  }
]
// 地址配置
export const addressConfig = [
  {
    title: '基础属性',
    collapseName: 'commonConfig',
    configs: [
      TypeConfig,
      NameConfig,
      HideLabelConfig,
      LabelWidthConfig,
      customClassConfig,
      RuleConfig,
      {
        name: 'hideLabel',
        // title: '详细地址',
        borderTop: true,
        setter: { componentName: 'AddressSetter' }
      },
      eventConfig
    ]
  },
  {
    title: '校验属性',
    collapseName: 'validateConfig',
    configs: [
      {
        direction: 'vertical',
        setter: { componentName: 'RuleSetter', rules: ['must'] }
      }
    ]
  }
]
// 组织配置
export const organizationConfig = [
  {
    title: '基础属性',
    collapseName: 'commonConfig',
    configs: [
      TypeConfig,
      {
        name: 'name',
        title: '名称',
        required: true,
        tip: '请注意表单分享时，本组件无法正常使用',
        setter: { componentName: 'NameSetter' }
      },
      placeholderConfig,
      HideLabelConfig,
      LabelWidthConfig,
      WidthConfig,
      customClassConfig,
      {
        name: 'multiple',
        title: '多选',
        borderTop: true,
        setter: { componentName: 'SwitchSetter' }
      },
      {
        name: 'isInitNode',
        title: '根节点',
        setter: { componentName: 'OrganizationSetter' }
      },
      RuleConfig,
      eventConfig
    ]
  },
  {
    title: '校验属性',
    collapseName: 'validateConfig',
    configs: [
      {
        direction: 'vertical',
        setter: { componentName: 'RuleSetter', rules: ['must'] }
      }
    ]
  }
]

export default {
  qrCode: {
    name: '条码',
    icon: 'qr-code-line',
    qrCodeRelatedFieldsFilters: [
      'input',
      'textarea',
      'number',
      'radio',
      'checkbox',
      'select',
      'date',
      'rate',
      'switches',
      'slider',
      'address',
      'organization',
      'member',
      'cascader',
      'editor',
      'uuid'
    ], // 二维码动态关联字段可选组件范围
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          HideLabelConfig,
          customClassConfig,
          RuleConfig,
          {
            direction: 'vertical',
            setter: {
              componentName: 'QrCodeSetter'
            }
          }
        ]
      }
    ]
  },
  personName: {
    name: '姓名',
    icon: 'user-line',
    showDefaultValue: true
  },
  personGender: {
    name: '性别',
    icon: 'men-line',
    showDefaultValue: true
  },
  idCard: {
    name: '身份证号码',
    icon: 'folder-user-line',
    showDefaultValue: true
  },
  unifiedSocialCreditCode: {
    name: '统一社会信用代码',
    icon: 'barcode-box-line',
    showDefaultValue: true
  },
  cellPhoneNumber: {
    name: '手机号码',
    icon: 'smartphone-line',
    showDefaultValue: true
  },
  telephoneNumber: {
    name: '固定电话',
    icon: 'phone-line',
    showDefaultValue: true
  },
  email: {
    name: '电子邮箱',
    icon: 'mail-line',
    showDefaultValue: true
  },
  zipCode: {
    name: '邮政编码',
    icon: 'mail-settings-line',
    showDefaultValue: true
  },
  administrativeDivision: {
    name: '行政区划',
    icon: 'government-line'
  },
  // Address: {
  //   name: '地址',
  //   icon: 'home-gear-line',
  //   showDefaultValue: false
  // },
  remark: {
    name: '备注',
    icon: 'sticky-note-line',
    showDefaultValue: true
  },
  funds: {
    name: '资金',
    icon: 'money-cny-box-line',
    showDefaultValue: true
  },
  carNumber: {
    name: '车牌号',
    icon: 'car-line',
    showDefaultValue: true
  },
  text: {
    name: '文字',
    icon: 'character-recognition-line',
    notFormItem: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'text',
            title: '文字',
            setter: {
              componentName: 'InputSetter',
              rows: 8
            }
          },
          {
            name: 'contentPosition',
            title: '水平排列',
            setter: {
              componentName: 'RadioSetter',
              showIcon: true,
              props: {
                options: positionOptions
              }
            }
          },
          {
            direction: 'vertical',
            setter: {
              componentName: 'FontSetter'
            }
          },
          {
            name: 'marginTop',
            title: '上间距',
            unit: 'px',
            setter: { componentName: 'NumberSetter' }
          },
          {
            name: 'marginBottom',
            title: '下间距',
            unit: 'px',
            setter: { componentName: 'NumberSetter' }
          },
          RuleConfig
        ]
      }
    ]
  },
  input: {
    name: '单行文本',
    icon: 'layout-left-2-line',
    showDefaultValue: true,
    config: inputConfig
  },
  textarea: {
    name: '多行文本',
    icon: 'file-list-line',
    showDefaultValue: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          placeholderConfig,
          {
            name: 'isVariableDefaultValue',
            title: '默认值类型',
            setter: {
              componentName: 'RadioSetter',
              helpWarn: true, // 帮助提示
              props: {
                options: [
                  { label: '静态数据', value: 'static' },
                  { label: '变量', value: 'variable' },
                  { label: '计算公式', value: 'formula' }
                ]
              }
            }
          },
          {
            name: 'defaultValue',
            title: '默认值',
            setter: {
              componentName: 'DefaultValueSetter'
            }
          },
          HideLabelConfig,
          LabelWidthConfig,
          WidthConfig,
          customClassConfig,
          {
            name: 'rows',
            title: '最小高度',
            borderTop: true,
            unit: '行',
            setter: { componentName: 'NumberSetter' }
          },
          {
            name: 'autosize',
            title: '自适应高度',
            setter: { componentName: 'SwitchSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: {
              componentName: 'RuleSetter',
              rules: ['must', 'regexp', 'custom']
            }
          }
        ]
      }
    ]
  },
  number: {
    name: '数字',
    icon: 'increase-decrease-line',
    showDefaultValue: true,
    config: numberConfig
  },
  radio: {
    name: '单选框组',
    icon: 'radio-button-line',
    config: radioConfig
  },
  checkbox: {
    name: '多选框组',
    icon: 'checkbox-line',
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          HideLabelConfig,
          LabelWidthConfig,
          WidthConfig,
          customClassConfig,
          {
            name: 'inline',
            title: '布局方式',
            borderTop: true,
            setter: {
              componentName: 'RadioSetter',
              props: {
                options: [
                  { label: '块级', value: false },
                  { label: '行内', value: true }
                ]
              }
            }
          },
          {
            name: 'optionStyle',
            title: '样式',
            tip: '选项样式: 子表单中该项建议设置为经典',
            setter: {
              componentName: 'RadioSetter',
              props: {
                options: [
                  { label: '经典', value: 'default' },
                  { label: '带边框', value: 'border' },
                  { label: '按钮', value: 'button' }
                ]
              }
            }
          },
          {
            direction: 'vertical',
            setter: { componentName: 'RemoteOptionsSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
          }
        ]
      }
    ]
  },
  select: {
    name: '下拉选择框',
    icon: 'arrow-down-line',
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          placeholderConfig,
          HideLabelConfig,
          LabelWidthConfig,
          WidthConfig,
          customClassConfig,
          {
            name: 'select',
            title: '多选',
            borderTop: true,
            setter: { componentName: 'SwitchSetter' }
          },
          {
            name: 'filterable',
            title: '可搜索',
            setter: { componentName: 'SwitchSetter' }
          },
          {
            borderTop: true,
            direction: 'vertical',
            setter: { componentName: 'RemoteOptionsSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
          }
        ]
      }
    ]
  },
  time: {
    name: '时间选择器',
    icon: 'time-line',
    showDefaultValue: true
  },
  date: {
    name: '日期选择器',
    icon: 'calendar-line',
    showDefaultValue: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          placeholderConfig,
          {
            name: 'isVariableDefaultValue',
            title: '默认值类型',
            setter: {
              componentName: 'RadioSetter',
              props: {
                options: [
                  { label: '静态数据', value: 'static' },
                  { label: '当前日期', value: 'current' },
                  { label: '计算公式', value: 'formula' }
                ]
              }
            }
          },
          {
            name: 'defaultValue',
            title: '默认值',
            setter: {
              componentName: 'DefaultValueSetter'
            }
          },
          HideLabelConfig,
          LabelWidthConfig,
          WidthConfig,
          customClassConfig,
          {
            name: 'type',
            title: '类型',
            borderTop: true,
            setter: {
              componentName: 'DateTypeSetter'
            }
          },
          {
            direction: 'vertical',
            setter: {
              componentName: 'SelectSetter',
              multiple: false,
              showTip: true,
              props: {
                options: [
                  { label: '仅年份(yyyy)', value: 'yyyy' },
                  { label: '年-月(yyyy-MM)', value: 'yyyy-MM' },
                  { label: '年-月-日(yyyy-MM-dd)', value: 'yyyy-MM-dd' },
                  {
                    label: '日期时间(yyyy-MM-dd HH:mm:ss)',
                    value: 'yyyy-MM-dd HH:mm:ss'
                  }
                ]
              }
            }
          },
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
          }
        ]
      }
    ]
  },
  rate: {
    name: '评分',
    icon: 'star-smile-line',
    showDefaultValue: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          {
            name: 'defaultValue',
            title: '默认值',
            borderTop: true,
            setter: {
              componentName: 'RateSetter',
              allowHalf: false,
              max: 5,
              clear: true
            }
          },
          HideLabelConfig,
          LabelWidthConfig,
          customClassConfig,
          {
            name: 'allowHalf',
            title: '允许半选',
            borderTop: true,
            setter: { componentName: 'SwitchSetter' }
          },
          {
            name: 'clearable',
            title: '允许清空',
            setter: { componentName: 'SwitchSetter' }
          },
          {
            name: 'showScore',
            title: '显示分数',
            setter: { componentName: 'SwitchSetter' }
          },
          {
            name: 'suffix',
            title: '分数单位',
            setter: { componentName: 'InputSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must'] }
          }
        ]
      }
    ]
  },
  switches: {
    name: '开关',
    icon: 'toggle-line',
    showDefaultValue: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          {
            name: 'defaultValue',
            title: '默认值',
            borderTop: true,
            setter: {
              componentName: 'SwitchSetter'
            }
          },
          HideLabelConfig,
          LabelWidthConfig,
          customClassConfig,
          {
            name: 'inactiveText',
            title: '关闭时文字',
            borderTop: true,
            setter: { componentName: 'InputSetter' }
          },
          {
            name: 'activeText',
            title: '打开时文字',
            setter: { componentName: 'InputSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
          }
        ]
      }
    ]
  },
  slider: {
    name: '滑块',
    icon: 'equalizer-line',
    showDefaultValue: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          {
            name: 'defaultValue',
            title: '默认值',
            borderTop: true,
            setter: {
              componentName: 'NumberSetter'
            }
          },
          HideLabelConfig,
          LabelWidthConfig,
          WidthConfig,
          customClassConfig,
          {
            name: 'min',
            title: '最小值',
            borderTop: true,
            setter: {
              componentName: 'NumberSetter',
              controls: false,
              unit: 'suffix'
            }
          },
          {
            name: 'max',
            title: '最大值',
            setter: {
              componentName: 'NumberSetter',
              controls: false,
              unit: 'suffix'
            }
          },
          {
            name: 'step',
            title: '步长',
            setter: {
              componentName: 'NumberSetter',
              controls: false,
              unit: 'suffix'
            }
          },
          {
            name: 'suffix',
            title: '显示单位',
            setter: {
              componentName: 'InputSetter',
              placeholder: '如15℃，可输入“℃”'
            }
          },
          {
            name: 'showSuffix',
            title: '显示输入框',
            setter: { componentName: 'SwitchSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
          }
        ]
      }
    ]
  },
  button: {
    name: '按钮',
    icon: 'mouse-line',
    notFormItem: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'buttonName',
            title: '文字',
            borderTop: true,
            setter: { componentName: 'InputSetter' }
          },
          {
            name: 'contentPosition',
            title: '水平排列',
            setter: {
              componentName: 'RadioSetter',
              showIcon: true,
              props: {
                options: positionOptions
              }
            }
          },
          {
            name: 'width',
            title: '宽度',
            switch: 'isWidgetWidth',
            setter: { componentName: 'WidthSetter' }
          },
          {
            name: 'buttonSize',
            title: '尺寸',
            setter: {
              componentName: 'RadioSetter',
              props: {
                options: [
                  { label: '大', value: 'large' },
                  { label: '中', value: 'medium' },
                  { label: '小', value: 'small' },
                  { label: '迷你', value: 'mini' }
                ]
              }
            }
          },
          {
            name: 'buttonType',
            title: '颜色',
            setter: { componentName: 'ButtonColorSetter', showText: true }
          },
          {
            name: 'buttonPlain',
            title: '底色半透明',
            setter: { componentName: 'SwitchSetter' }
          },
          {
            name: 'buttonRound',
            title: '圆角按钮',
            setter: { componentName: 'SwitchSetter' }
          },
          {
            name: 'buttonCircle',
            title: '圆形按钮',
            setter: { componentName: 'SwitchSetter' }
          },
          {
            name: 'showInPrintRead',
            title: '打印态展示',
            setter: { componentName: 'SwitchSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      }
    ]
  },
  link: {
    name: '文字链接',
    icon: 't-box-line',
    notFormItem: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'text',
            title: '文字',
            borderTop: true,
            setter: {
              componentName: 'InputSetter',
              rows: 8
            }
          },
          {
            name: 'contentPosition',
            title: '水平排列',
            setter: {
              componentName: 'RadioSetter',
              showIcon: true,
              props: {
                options: positionOptions
              }
            }
          },
          {
            name: 'linkType',
            title: '颜色',
            setter: { componentName: 'ButtonColorSetter', showText: false }
          },
          {
            name: 'href',
            title: '链接地址',
            setter: {
              componentName: 'InputSetter',
              rows: 3,
              placeholder: '请输入URL，绝对地址前请输入http://'
            }
          },
          {
            name: 'underline',
            title: '悬停下划线',
            setter: { componentName: 'SwitchSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      }
    ]
  },
  editor: {
    name: '富文本',
    icon: 'edit-circle-line',
    showDefaultValue: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          HideLabelConfig,
          LabelWidthConfig,
          WidthConfig,
          customClassConfig,
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
          }
        ]
      }
    ]
  },
  cascader: {
    name: '级联选择器',
    icon: 'link',
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          placeholderConfig,
          HideLabelConfig,
          LabelWidthConfig,
          WidthConfig,
          customClassConfig,
          {
            name: 'filterable',
            title: '可搜索',
            setter: { componentName: 'SwitchSetter' }
          },
          {
            name: 'checkStrictly',
            title: '任意节点',
            setter: { componentName: 'SwitchSetter' }
          },
          {
            direction: 'vertical',
            setter: { componentName: 'RemoteOptionsSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must', 'custom'] }
          }
        ]
      }
    ]
  },
  divider: {
    name: '分割线',
    icon: 'separator',
    notFormItem: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'text',
            title: '文字',
            borderTop: true,
            setter: {
              componentName: 'InputSetter',
              rows: 1
            }
          },
          {
            name: 'contentPosition',
            title: '文字位置',
            setter: {
              componentName: 'RadioSetter',
              showIcon: true,
              props: {
                options: positionOptions
              }
            }
          },
          {
            name: 'paddingTop',
            title: '上间距',
            unit: 'px',
            setter: { componentName: 'NumberSetter' }
          },
          {
            name: 'paddingBottom',
            title: '下间距',
            unit: 'px',
            setter: { componentName: 'NumberSetter' }
          },
          RuleConfig
        ]
      }
    ]
  },
  grid: {
    name: '栅格布局',
    icon: 'layout-column-line',
    notFormItem: true,
    isContainer: true,
    allowList: [],
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'align',
            title: '垂直排列',
            borderTop: true,
            setter: {
              componentName: 'RadioSetter',
              showIcon: true,
              props: {
                options: [
                  { label: '顶部对齐', value: 'top', icon: 'align-top' },
                  { label: '居中', value: 'middle', icon: 'align-vertically' },
                  { label: '底部对齐', value: 'bottom', icon: 'align-bottom' }
                ]
              }
            }
          },
          RuleConfig
        ]
      }
    ]
  },
  table: {
    name: '子表单',
    icon: 'terminal-window-line',
    notFormItem: true,
    isContainer: true,
    allowList: [
      'input',
      'textarea',
      'number',
      'radio',
      'checkbox',
      'select',
      'date',
      'rate',
      'switches',
      'slider',
      'upload',
      'imageUpload',
      'address',
      'organization',
      'member',
      'uuid',
      'cascader'
    ],
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          HideLabelConfig,
          {
            name: 'displayMode',
            title: '显示',
            tip: '仅在PC端模式生效,其他端默认为动态节模式',
            setter: {
              componentName: 'RadioSetter',
              props: {
                options: [
                  { label: '动态行', value: 'table' },
                  { label: '动态节', value: 'section' }
                ]
              }
            }
          },
          {
            direction: 'vertical',
            setter: { componentName: 'TableSetter' }
          },
          RuleConfig,
          eventConfig
        ]
      }
    ]
  },
  inline: {
    name: '按钮组',
    icon: 'window-2-line',
    notFormItem: true,
    isContainer: true,
    allowList: ['button'],
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [TypeConfig, NameConfig, customClassConfig, RuleConfig]
      }
    ]
  },
  tabs: {
    name: '标签页',
    icon: 'window-2-line',
    notFormItem: true,
    isContainer: true,
    allowList: ['grid', 'table'],
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'type',
            title: '类型',
            borderTop: true,
            setter: {
              componentName: 'RadioSetter',
              props: {
                options: [
                  { label: '默认', value: '' },
                  { label: '选项卡', value: 'card' },
                  { label: '卡片化', value: 'border-card' }
                ]
              }
            }
          },
          {
            name: 'tabPosition',
            title: '选项卡位置',
            setter: {
              componentName: 'RadioSetter',
              showIcon: true,
              props: {
                options: [
                  { label: '顶部', value: 'top', icon: 'layout-top-line' },
                  { label: '左边', value: 'left', icon: 'layout-left-line' },
                  { label: '右边', value: 'right', icon: 'layout-right-line' }
                ]
              }
            }
          },
          {
            name: 'events',
            title: '标签配置项',
            direction: 'vertical',
            setter: { componentName: 'TabAddSetter', title: '标签' }
          },
          RuleConfig
        ]
      }
    ]
  },
  report: {
    name: '网格布局',
    icon: 'table-line',
    notFormItem: true,
    isContainer: true,
    allowList: [],
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'borderWidth',
            title: '边框宽度',
            borderTop: true,
            setter: {
              componentName: 'NumberSetter'
            }
          },
          {
            name: 'borderColor',
            title: '边框颜色',
            setter: {
              componentName: 'ColorSetter'
            }
          },
          RuleConfig
        ]
      }
    ]
  },
  td: {
    name: 'TD',
    icon: 'table-line',
    notFormItem: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          {
            name: 'height',
            title: '高度',
            setter: {
              componentName: 'InputSetter',
              placeholder: '可输入高度定义 如 100px'
            }
          },
          {
            name: 'customClass',
            title: '自定义样式',
            setter: {
              componentName: 'CustomClassSetter'
            }
          }
        ]
      }
    ]
  },
  card: {
    name: '卡片',
    icon: 'input-method-line',
    notFormItem: true,
    isContainer: true,
    allowList: ['grid', 'table'],
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'showHeader',
            title: '显示卡片头',
            borderTop: true,
            setter: {
              componentName: 'CheckboxSetter',
              label: '开启'
            }
          },
          {
            name: 'shadow',
            title: '卡片阴影',
            setter: {
              componentName: 'RadioSetter',
              props: {
                options: [
                  { label: '总是', value: 'always' },
                  { label: '悬浮时', value: 'hover' },
                  { label: '从不', value: 'never' }
                ]
              }
            }
          },
          RuleConfig
        ]
      }
    ]
  },
  collapse: {
    name: '折叠面板',
    icon: 'stack-line',
    notFormItem: true,
    isContainer: true,
    allowList: ['grid', 'table'],
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          {
            name: 'accordion',
            title: '手风琴模式',
            borderTop: true,
            setter: {
              componentName: 'CheckboxSetter',
              label: '开启',
              tip: '开启手风琴模式后,每次只能展开一个面板'
            }
          },
          {
            name: 'events',
            title: '面板配置项',
            direction: 'vertical',
            setter: { componentName: 'TabAddSetter', title: '面板' }
          },
          RuleConfig
        ]
      }
    ]
  },
  upload: {
    name: '上传附件',
    icon: 'file-upload-line',
    showDefaultValue: false,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          HideLabelConfig,
          LabelWidthConfig,
          customClassConfig,
          RuleConfig,
          {
            name: 'limit',
            title: '数量限制',
            unit: '个',
            borderTop: true,
            setter: { componentName: 'NumberSetter' }
          },
          {
            name: 'size',
            title: '大小限制',
            unit: 'MB',
            setter: { componentName: 'NumberSetter' }
          },
          {
            name: 'accept',
            title: '格式限制',
            setter: {
              componentName: 'InputSetter',
              placeholder: '请输入上传格式限制'
            }
          },
          {
            name: 'tip',
            title: '上传提示',
            setter: {
              componentName: 'InputSetter',
              placeholder: '请输入上传提示'
            }
          },
          {
            name: 'multiple',
            title: '文件多选',
            setter: { componentName: 'CheckboxSetter' }
          },
          {
            name: 'searchable',
            title: '可搜索',
            setter: { componentName: 'CheckboxSetter' }
          },
          {
            name: 'isBatchDownload',
            title: '批量下载',
            setter: { componentName: 'CheckboxSetter' }
          },
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must'] }
          }
        ]
      }
    ]
  },
  imageUpload: {
    name: '上传图片',
    icon: 'image-add-fill',
    showDefaultValue: false,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          HideLabelConfig,
          LabelWidthConfig,
          customClassConfig,
          RuleConfig,
          {
            name: 'limit',
            title: '数量限制',
            borderTop: true,
            unit: '个',
            setter: { componentName: 'NumberSetter' }
          },
          {
            name: 'size',
            title: '大小限制',
            unit: 'MB',
            setter: { componentName: 'NumberSetter' }
          },
          {
            name: 'accept',
            title: '格式限制',
            setter: {
              componentName: 'InputSetter',
              placeholder: '请输入上传格式限制'
            }
          },
          {
            name: 'tip',
            title: '上传提示',
            setter: {
              componentName: 'InputSetter',
              placeholder: '请输入上传提示'
            }
          },
          {
            name: 'multiple',
            title: '文件多选',
            setter: { componentName: 'CheckboxSetter' }
          },
          {
            name: 'searchable',
            title: '可搜索',
            borderTop: true,
            setter: { componentName: 'CheckboxSetter' }
          },
          {
            name: 'isBatchDownload',
            title: '批量下载',
            setter: { componentName: 'CheckboxSetter' }
          }
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must'] }
          }
        ]
      }
    ]
  },
  organization: {
    name: '组织机构',
    icon: 'organization-chart',
    showDefaultValue: false,
    shareFormNotApplicableTip: true,
    config: organizationConfig
  },
  member: {
    name: '人员选择',
    icon: 'user-2-line',
    showDefaultValue: false,
    shareFormNotApplicableTip: true,
    config: organizationConfig
  },
  uuid: {
    name: '唯一标识码',
    icon: 'repeat-one-line',
    showDefaultValue: false,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          HideLabelConfig,
          LabelWidthConfig,
          customClassConfig,
          RuleConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must'] }
          }
        ]
      }
    ]
  },
  sequence: {
    name: '流水号',
    icon: 'barcode-box-line',
    showDefaultValue: false,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          HideLabelConfig,
          LabelWidthConfig,
          customClassConfig,
          RuleConfig,
          {
            direction: 'vertical',
            setter: { componentName: 'SequenceSetter' }
          }
        ]
      }
    ]
  },
  address: {
    name: '地址',
    icon: 'map-pin-line',
    showDefaultValue: false,
    config: addressConfig
  },
  relatedForm: {
    name: '关联表单',
    icon: 'links-line',
    showDefaultValue: false,
    shareFormNotApplicableTip: false,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          placeholderConfig,
          HideLabelConfig,
          LabelWidthConfig,
          customClassConfig,
          RuleConfig,
          {
            borderTop: true,
            direction: 'vertical',
            setter: { componentName: 'RelatedFormSetter' }
          },
          eventConfig
        ]
      },
      {
        title: '校验属性',
        collapseName: 'validateConfig',
        configs: [
          {
            direction: 'vertical',
            setter: { componentName: 'RuleSetter', rules: ['must'] }
          }
        ]
      }
    ]
  },
  iframe: {
    name: '嵌入网页',
    icon: 'window-fill',
    showDefaultValue: false,
    notFormItem: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          RuleConfig,
          {
            direction: 'vertical',
            setter: {
              componentName: 'IframeSetter'
            }
          }
        ]
      }
    ]
  },
  image: {
    name: '嵌入图片',
    icon: 'image-line',
    showDefaultValue: false,
    notFormItem: true,
    config: [
      {
        title: '基础属性',
        collapseName: 'commonConfig',
        configs: [
          TypeConfig,
          NameConfig,
          customClassConfig,
          RuleConfig,
          {
            direction: 'vertical',
            setter: {
              componentName: 'ImageSetter'
            }
          },
          eventConfig
        ]
      }
    ]
  }
}
